//
//  PywCancelOrderApi.m
//  PywSdk
//
//  Created by Jade on 16/8/15.
//  Copyright © 2016年 zero. All rights reserved.
//

#import "PywCancelOrderApi.h"
#import "AIFFailPayManager.h"
#import "PropertyListReformer.h"
#import "PywMBProgressHUD+Pyw.h"
@implementation PywCancelOrderApi
/**
 *  取消订单
 */
- (void)getFailPayCancelOrderWithOrderNum:(NSString *)orderNum
                                  success:(Successd)success
                                     fail:(Failure)fail
{
    self.successd = success;
    self.failure = fail;
    AIFFailPayManager *failPayManager = [AIFFailPayManager manager];
    failPayManager.delegate = self;
    failPayManager.orderno = orderNum;
    [failPayManager loadData];
}


#pragma mark - ETAPIManagerCallBackDelegate

- (void)managerCallAPIDidSuccess:(ETApiBaseManager *)manager{
    [PywMBProgressHUD hideHUD];
    PropertyListReformer *reformer = [[PropertyListReformer alloc] init];
    NSDictionary *dict = [manager fetchDataWithReformer:reformer];
    if (self.successd) {
        self.successd(nil,dict);
    }
}

- (void)managerCallApiDidFailed:(ETApiBaseManager *)manager{
    [PywMBProgressHUD hideHUD];
    if (self.failure) {
        self.failure(nil);
    }
}
@end
